package raytracing

type HitRecord struct {
	P         Vec3
	Normal    Vec3
	Material  Material
	T         float64
	FrontFace bool
}

func (rec *HitRecord) SetFaceNormal(r *Ray, outwardNormal Vec3) {
	rec.FrontFace = r.Direction.Dot(outwardNormal) < 0
	if rec.FrontFace {
		rec.Normal = outwardNormal
	} else {
		rec.Normal = outwardNormal.Negate()
	}
}

type Hittable interface {
	Hit(r *Ray, t_min float64, t_max float64, rec *HitRecord) bool
}
